using System.Collections.Generic;
using System.Web.Mvc;
using Roommate.Services;
using Roommate.Services.Messages;
using Roommate.Web.Models;
using Roommate.Web.Models.Booking;
using MvcContrib;

namespace Roommate.Web.Controllers
{
    public class BookingController : Controller
    {
        private readonly IBookingService bookingService;

        public BookingController(IBookingService bookingService)
        {
            this.bookingService = bookingService;
        }

        [AcceptVerbs(HttpVerbs.Get)]
        public ActionResult Create()
        {
            return View(new CreateViewModel());
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Create(ReservationRequest reservationRequest)
        {
            return this.RedirectToAction(c => c.Display(1));
        }

        public ActionResult Display(int reservationId)
        {
            var model = new DisplayViewModel { Reservation = new Reservation { Id = reservationId } };
            return View(model);
        }




        public ActionResult FindRooms(RoomRequirements requirements)
        {
            return Json(new List<Room>
                    {
                        new Room
                            {
                                Number = "201",
                                Type="Single",
                                Description="West wing",
                                Price = 1100.0
                            },
                        new Room
                            {
                                Number = "301",
                                Type="Single",
                                Description="Non smoking",
                                Price = 1000.0
                            }
                    });
        }

        public ActionResult SelectReservationType()
        {

            var model = new SelectReservationTypeViewModel
            {
                ReservationTypes = new List<BookingType>
                                                {
                                                    new BookingType{Id = 1,Name="Logibokning enkel"},
                                                    new BookingType{Id = 2,Name="Logibokning grupp"},
                                                    new BookingType{Id = 3,Name="Konferens"},
                                                    new BookingType{Id = 4,Name="Restaurang"}
                                                }
            };

            return View(model);
        }

    }


}